<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class MAccountInfoController
extends MApplicationComponent
implements MIController
{
    
    public function invoke($uri=null)
    {
        $user   = MUserManager::getInstance()->getCurrentUser();
        $device = MUserManager::getInstance()->getCurrentDevice();
                $user->space = MUtils::totalSize($user->id);
        $user->usedSpace = MUser::getUsedSpaceById($user->id);
        
        $ret_data = array();
        $ret_data['user_name']         = $user->user_name;
        $ret_data['display_name']      = "{$user->nick}";
        $ret_data['uid']               = $user->user_uuid;
        $ret_data['space']             = (double)$user->space;
        $ret_data['used_space']        = (double)$user->usedSpace;
        $ret_data['email']             = $user->email;
        $ret_data['phone']             = $user->phone;
        $ret_data['did']               = $device->user_device_uuid;
        
        echo json_encode($ret_data);
    }
}
?>